// @ts-check
// `@type` JSDoc annotations allow editor autocompletion and type checking
// (when paired with `@ts-check`).
// There are various equivalent ways to declare your Docusaurus config.
// See: https://docusaurus.io/docs/api/docusaurus-config

import {
  duotoneDark,
  gruvboxMaterialDark,
  gruvboxMaterialLight, jettwaveDark,
  nightOwl,
  synthwave84,
  themes as prismThemes
} from 'prism-react-renderer';

// This runs in Node.js - Don't use client-side code here (browser APIs, JSX...)

/** @type {import('@docusaurus/types').Config} */
const config = {
  title: '张鉴的学习笔记',
  tagline: '加油吧',
  favicon: 'img/favicon.ico',

  // Set the production url of your site here
  url: 'https://your-docusaurus-site.example.com',
  // Set the /<baseUrl>/ pathname under which your site is served
  // For GitHub pages deployment, it is often '/<projectName>/'
  baseUrl: '/',

  // GitHub pages deployment config.
  // If you aren't using GitHub pages, you don't need these.
  organizationName: 'zj', // Usually your GitHub org/user name.
  projectName: 'docusaurus', // Usually your repo name.

  onBrokenLinks: 'throw',
  onBrokenMarkdownLinks: 'warn',

  // Even if you don't use internationalization, you can use this field to set
  // useful metadata like html lang. For example, if your site is Chinese, you
  // may want to replace "en" with "zh-Hans".
  i18n: {
    defaultLocale: 'zh-Hans',
    locales: ['zh-Hans'],
  },

  presets: [
    [
      'classic',
      /** @type {import('@docusaurus/preset-classic').Options} */
      ({
        docs: {
          sidebarPath: './sidebars.js',
          // Please change this to your repo.
          // Remove this to remove the "edit this page" links.
          editUrl:
            'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
        },
        blog: {
          showReadingTime: true,
          feedOptions: {
            type: ['rss', 'atom'],
            xslt: true,
          },
          // Please change this to your repo.
          // Remove this to remove the "edit this page" links.
          editUrl:
            'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
          // Useful options to enforce blogging best practices
          onInlineTags: 'warn',
          onInlineAuthors: 'warn',
          onUntruncatedBlogPosts: 'warn',
        },
        theme: {
          customCss: './src/css/custom.css',
        },
      }),
    ],
  ],

  themeConfig:
    /** @type {import('@docusaurus/preset-classic').ThemeConfig} */
    ({
      // Replace with your project's social card
      image: 'img/docusaurus-social-card.jpg',
      navbar: {
        title: 'My blog',
        logo: {
          alt: 'My Site Logo',
          src: 'img/logo.svg',
        },
        items: [
          {
            type: 'dropdown',
            sidebarId: 'study',
            position: 'left',
            label: '学习',
            items:[
              {
                type:'docSidebar',
                sidebarId:'reactSidebar',
                label:'react学习'
              },
              {
                type: 'docSidebar',
                sidebarId:'tsProjectsSidebar',
                label:'ts学习'
              },
              {
                type: 'docSidebar',
                sidebarId:'webpackSidebar',
                label: 'webpack学习'
              },
              {
                type:'docSidebar',
                sidebarId:'mybatisSidebar',
                label:'mybatis学习'
              }
            ]
          },{
            type: 'dropdown',
            sidebarId: 'project',
            position: 'left',
            label: '项目',
            items:[
              {
                type:'docSidebar',
                sidebarId:'frontedProjectsSidebar',
                label:'前端项目'
              },
            ]
          },
          {
            type:'docSidebar',
            sidebarId:'frontendSidebar',
            label:'前端'
          },
          {
            type:'docSidebar',
            sidebarId:'settingsSidebar',
            label:'杂七杂八的配置',
          },
          {
            type:'docSidebar',
            sidebarId:'frontedToolsSidebar',
            label:'前端组件库',
          },
          {
            type:'dropdown',
            sidebarId:'toolsSidebar',
            position: 'left',
            label: '工具函数',
            items:[
              {
                type:'docSidebar',
                sidebarId:'javaToolsSidebar',
                label:'java工具函数',
              }
            ]
          },{
            type:'dropdown',
            sidebarId:'bugSidebar',
            position: 'left',
            label: 'bug记录',
            items:[
              {
                type:'docSidebar',
                sidebarId:'bugSidebar',
                label:'bug记录',
              }
            ]
          },
          {to: '/blog', label: 'Blog', position: 'left'},//像是上面的tab栏左边的
          {//上面的tab栏右边的
            href: 'https://gitee.com/zj2966534592',
            label: 'Gitee',
            position: 'right',
          },
        ],
      },
      footer: {//下面的
        style: 'dark',
        links: [
          {
            title: '文档',
            items: [
              {
                label: 'react',
                to: '/docs/react/welcome',
              },
            ],
          },
          {
            title: '这个博客的中文开发文档',
            items: [
              {
                label: 'Docusaurus 中文网',
                href: 'https://docusaurus.nodejs.cn/docs',
              }
            ],
          },
          {
            title: 'java涉及的一些中文官网',
            items: [
              {
                label: 'spring中文网',
                href: 'https://springdoc.cn/docs/',
              }
            ]
          },
          {
            title: '前端中文官网',
            items: [
              {
                label:'前端中文网',
                href: 'https://nodejs.cn/'
              },
              {
                label: 'ant design',
                href: 'https://ant-design.antgroup.com/index-cn',
              },
              {
                label:'很好看的一些css组件',
                href: 'https://uiverse.io/',
              },
              {
                label: 'particle.js(粒子效果)的替代品',
                href: 'https://particles.js.org/',
              }
            ],
          },
        ],
        // copyright: `Copyright © ${new Date().getFullYear()} My Project, Inc. Built with Docusaurus.`,
      },
      prism: {
        theme: prismThemes.gruvboxMaterialLight,
        darkTheme: prismThemes.dracula,
        additionalLanguages: ['java','bash'],
      },
    }),
  markdown:{
    anchors:{
      maintainCase:true
    },
    mermaid:true
  },
  themes:['@docusaurus/theme-mermaid']
};

export default config;
